﻿using System;
using System.Collections.Generic;
using System.Text;

namespace game2
{
    public class Player
    {
        private Core my_core;
        public elements MapBrush = elements.x;

        public void SetElementOnMap() 
        {
            int x,y;
            bool flag = true;
            while (flag)
            {
                my_core.ShowMap();
                Console.WriteLine("Enter the X and Y");
                string[] tokens = Console.ReadLine().Split();

                if (tokens.Length < 1) continue;

                //Parse element 0
                x = int.Parse(tokens[0]);

                //Parse element 1
                y = int.Parse(tokens[1]);

                if (my_core.GetMap(x, y) != elements.e)
                {
                    
                    continue;
                }
               // else
                {
                    my_core.SetMap(x, y, MapBrush);
                    flag = false;
                } 
           }
        }
        public Player(Core in_core){my_core = in_core;}
        ~Player() { }
    }
}
